var n = require("../../utils/http.js"),
  t =
    (require("../../utils/api.js"),
    require("../../utils/language/switchLanguage.js"));
Page({
  data: {},
  onLoad: function (n) {
    this.setData({ id: n.id }),
      this.getInvoiceDetail(n.id),
      this.initLanguage();
  },
  initLanguage: function () {
    var n = t.languageVersion(wx.getStorageSync("language"));
    this.setData({ _t: n, languageType: wx.getStorageSync("language") }),
      wx.setNavigationBarTitle({ title: n["发票详情"] });
  },
  toPage: function () {
    wx.navigateTo({
      url: "plugin-private://wx393d60d93f70599c/pages/RelatedOrder/index?orderSn=".concat(
        this.data.content.orderSn.join(","),
      ),
    });
  },
  CallPhone: function () {
    wx.makePhoneCall({ phoneNumber: wx.getStorageSync("telphoneNumber") });
  },
  againInvoice: function () {
    var n = this.data.content.totalPrice,
      t = this.data.content.id;
    wx.navigateTo({
      url: "plugin-private://wx393d60d93f70599c/pages/invoiceing/index?totalPrice="
        .concat(n, "&id=")
        .concat(t, "&from=info"),
    });
  },
  getInvoiceDetail: function (t) {
    var e = this;
    n.getInvoiceDetail(t).then(function (n) {
      var t = n.data;
      (t.orderSn = t.orderSn.split(",")), e.setData({ content: n.data });
    });
  },
  openDocument: function () {
    wx.downloadFile({
      url: this.data.content.invoiceUrl,
      success: function (n) {
        var t = n.tempFilePath;
        wx.openDocument({
          filePath: t,
          fileType: "pdf",
          showMenu: !0,
          success: function (n) {},
        });
      },
    });
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {},
  onReachBottom: function () {},
});
